﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string usename2 = "";
            string password2 = "";
            string usename1 = Request.Form["TextBox1"];
            string password1 = Request.Form["TextBox2"];
            if (PreviousPage!=null)
            {
                TextBox usenamebox = (TextBox)PreviousPage.FindControl("TextBox1");
                TextBox passwordbox = (TextBox)PreviousPage.FindControl("TextBox2");
                if (usenamebox!=null)
                {
                    usename2 = usenamebox.Text;
                }
                if (passwordbox!=null)
                {
                    password2 = passwordbox.Text;
                }
            }
            string usename3 = Request.Params["TextBox1"];
            string password3 = Request.Params["TextBox2"];
            string usename4 = Request.QueryString["n"];
            string password4 = Request.QueryString["p"];
            string usename5 = Request.Params["n"];
            string password5 = Request.Params["p"];
            Response.Write($"<h1>Form  ==>  你的账号是：{usename1}，你的密码是：{password1}<h1/><br/>");
            Response.Write($"<h1>PreviousPage  ==>  你的账号是：{usename2}， 你的密码是：{password2}<h1/><br/>");
            Response.Write($"<h1>Params  ==>  你的账户是：{usename3}， 你的密码是：{password3}<h1/><br/>");
            Response.Write($"<h1>QueryString  ==>  你的账户是：{usename4}， 你的密码是：{password4}<h1/><br/>");
            Response.Write($"<h1>Params  ==>  你的账号是：{usename5}，你的密码是{password5}<h1/><br/>");
        }
    }
}